package com.dmwork.service.interaction.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dmwork.service.interaction.entity.CmsColor;
import com.dmwork.service.interaction.entity.vo.CmsColorVo;
import com.dmwork.service.interaction.mapper.CmsColorMapper;
import com.dmwork.service.interaction.service.CmsColorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 网页颜色数据表 服务实现类
 * </p>
 *
 * @author 李天
 * @since 2021-10-24
 */
@Service
@Transactional
public class CmsColorServiceImpl extends ServiceImpl<CmsColorMapper, CmsColor> implements CmsColorService {

    @Autowired
    private CmsColorMapper cmsColorMapper;

    @Override
    public Page<CmsColorVo> selectPage(Integer page, Integer limit) {
        Page<CmsColorVo> selectPage=new Page<>(page, limit);
        selectPage = cmsColorMapper.getPage(selectPage);
        return selectPage;
    }

    @Override
    public String getColorValueByColorKey(String colorKey) {
        return cmsColorMapper.getColorValueByColorKey(colorKey);
    }
}
